<template>
  <div
    class="write-token"
    style="padding: 30px"
  >
    <a-textarea
      v-model:value="token"
      placeholder="请输入 token"
      :rows="4"
    />
    <a-button
      class="token-ok"
      :disabled="token === ''"
      @click="setToken"
    >
      确定
    </a-button>
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { ipc } from '../service';

const token = ref('');

function setToken(): void {
  if (token.value && token.value !== '') {
    ipc.setToken(token.value);
  }
}
</script>
<style lang="scss">
.token-ok {
  float: right;
  margin-right: 50px;
  margin-top: 50px;
}
</style>
